package lu.med.praxiswahl.wahlumed.client.menustructure;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import lu.med.praxiswahl.wahlumed.client.accountmanagement.UserAccountDialog;
import lu.med.praxiswahl.wahlumed.client.utilities.UniCode;
import lu.med.praxiswahl.wahlumed.client.wclient.Main;

/**
 * 
 * @author Lars Holger Roth
 * 
 */
public class MenuListenerAccountManagementActionListener implements
		ActionListener {
	private Main dataManager;

	public MenuListenerAccountManagementActionListener(Main dataManager) {
		this.dataManager = dataManager;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		if (dataManager.getCurrentUser().isAdmin())
			new UserAccountDialog(dataManager);
		else {
			JOptionPane.showMessageDialog(dataManager,
					"Sie ben" + UniCode.getoe() + "tigen Administratorrechte f"
							+ UniCode.getue() + "r diese Operation!");
			return;
		}
	}

}
